﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Krile.Kernel;
using Krile.Kernel.Control.Surface;
using System.Windows.Forms;
using Krile.Kernel.Control.Surface.MessageObjects;
using System.Drawing;
namespace Wassrile.Controls
{
    public class ChLabel : Text
    {
        public string chId;
        public ChLabel(string chid, string name)
            : base("#" + chid + "(" + name + ")", Color.White, Color.Gray)
        {
            chId = chid;
        }

        public override string HelptipText
        {
            get { return "クリックするとこのチャンネルを抽出します..."; }
        }

        public override void OnMouseClick(object sender, ChainMouseEventArgs e)
        {
            Bridge.MainForm.AddInheritedTab(
                "チャンネル \"" + chId + "\" を{0}から抽出",
                new[] { new Searchs.SearchByChannelId() { Arguments = chId, SearchType = Krile.Common.DefaultSearchDataBase.SearchTypes.Equals } });
        }

        public override void OnMouseEnter(object sender, ChainMouseEventArgs e)
        {
            if(ParentForm != null)
                ParentForm.SetCursor(Cursors.Hand);
        }

        public override void OnMouseLeave(object sender, ChainMouseEventArgs e)
        {
            if (ParentForm != null)
                ParentForm.SetCursor(Cursors.Default);
        }
    }
}
